package com.jack.blog.dao;

import com.jack.blog.entity.Blog;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BlogMapper {

    List<Blog> queryBlogsByUid(@Param("uid")int uid, @Param("begin")int begin, @Param("end")int end);
    List<Blog> queryBlogsByCid(@Param("cid") int cid, @Param("begin")int begin, @Param("end")int end);
    List<Blog> queryBlogsByTitle(@Param("uid")int uid, @Param("begin")int begin, @Param("end")int end, @Param("title")String blogTitle);
    int queryTopByUid(@Param("uid")int uid);
    Blog queryBlogById(@Param("id")int id);
    void insertBlog(@Param("blog")Blog blog);
    void updateBlogTop(@Param("id") int id, @Param("top")boolean top);
    void updateBlogInfo(@Param("id") int id, @Param("title")String title, @Param("blogAbstract")String blogAbstract, @Param("cid") int cid, @Param("cover")String cover, @Param("html")String html);
    void addBlogData(@Param("id") int id, @Param("browse")int browse, @Param("good")int good, @Param("bad")int bad, @Param("message")int message);
    void updateBlogData(@Param("blog")Blog blog);
    void deleteBlogById(@Param("id") int id);

}
